package com.bfxy.rabbit.api.business;

import com.bfxy.rabbit.api.exception.MessageRunTimeException;
import com.bfxy.rabbit.api.model.Message;

import java.util.List;

/**
 * $MessageProducer 生产者发送消息
 */
public interface MessageProducer {

    /**
     * 消息的发送
     * @param message
     * @throws MessageRunTimeException
     */
    void send(Message message) throws MessageRunTimeException;

    /**
     * 消息的批量发送
     * @param messageList
     * @throws MessageRunTimeException
     */
    void send(List<Message> messageList) throws MessageRunTimeException;

    /**
     * 消息的发送，附带SendCallback回调执行响应的业务逻辑处理
     * @param message
     * @param sendCallback
     * @throws MessageRunTimeException
     */
    void send(Message message, SendCallback sendCallback) throws MessageRunTimeException;

}
